﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteAdmin.Master" AutoEventWireup="true" CodeBehind="AgentesListado.aspx.cs" Inherits="WebApplication1.Admin.AgentesListado" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript">
    function confirmEditAspx() {
        var counter = ASPxGridViewAgentes.GetSelectedRowCount();

        if (counter > 1) {
            counter = 0;
            alert("Debe seleccionar un solo registro");
            return (false);
        }
        else if (counter == 1) {
            counter = 0;
            return (true);
        }
        else if (counter == 0) {
            counter = 0;
            alert("Debe seleccionar al  menos un registro");
            return (false);
        }
    }
				
    </script>
    <table style="width:100%;">
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            <dx:ASPxButton ID="btnNuevo" runat="server" Text="NUEVO" Theme="SoftOrange" 
                                onclick="btnNuevo_Click"  >
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnActualizar" runat="server" Text="MODIFICAR" Theme="SoftOrange" 
                                onclick="btnActualizar_Click">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx();}" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnEliminar" runat="server" Text="ELIMINAR" 
                                Theme="SoftOrange">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx();}" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnPublicar" runat="server" Text="PUBLICAR" 
                                Theme="SoftOrange" onclick="btnPublicar_Click">
                                <ClientSideEvents Click="function(s, e) { Callback.PerformCallback();  LoadingPanel.Show(); }" />
                            </dx:ASPxButton>
                        </td>
                    </tr>
                </table>
               </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxGridView ID="ASPxGridViewAgentes" runat="server"  ClientInstanceName="ASPxGridViewAgentes"
                    AutoGenerateColumns="False" Theme="Office2003Silver" Width="100%" 
                            KeyFieldName="AGE_ID">
                            <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                                    </dx:GridViewCommandColumn>
                                                   
                                <dx:GridViewDataTextColumn Caption="Id" FieldName="AGE_ID" VisibleIndex="1">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Departamento" FieldName="Departamento" VisibleIndex="3">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Nombres" VisibleIndex="2" 
                                    FieldName="AGE_NOMBRES_APELLIDOS" ExportWidth="2">
                             
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Area" FieldName="AREA" VisibleIndex="6">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Correo Electronico" FieldName="AGE_CORREO_ELECTRONICO" VisibleIndex="5">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Pagina Web" FieldName="AGE_PAGINA_WEB" VisibleIndex="7">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Genero" FieldName="AGENTES.AGE_GENERO" VisibleIndex="4">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="Municipio" VisibleIndex="3"> 
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="Estado" FieldName="AGE_ESTADO" VisibleIndex="8">
                                </dx:GridViewDataTextColumn>
                            </Columns>
                            <Settings ShowFilterRow="True" />
                            <Settings ShowFilterRow="True"></Settings>
                       </dx:ASPxGridView>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
